package app.mvc.view.components.panels
{
	import alternativa.gui.container.gridContainer.GridContainer;
	import alternativa.gui.controls.tree.TreeItemContainer;
	import alternativa.gui.data.DataProvider;
	import alternativa.gui.event.ListEvent;
	import alternativa.gui.theme.defaulttheme.container.panel.Panel;
	import alternativa.gui.theme.defaulttheme.controls.scrollBar.Track;
	import alternativa.gui.theme.defaulttheme.controls.tree.Tree;
	import alternativa.gui.theme.defaulttheme.event.PanelEvent;
	
	import app.mvc.model.VO.ControlsBarVO;
	import app.mvc.view.components.controls.BaseDragableControls;
	import app.mvc.view.components.dragDrop.DraggingObject;
	
	import globals.Global;
	
	import utils.Tracker;
	
	/**
	 * 控件条
	 * @author XiLing
	 */
	public class ControlsBar extends BasePanel
	{
		/**
		 * 所有可用控件表格
		 * @default 
		 */
		private var _uiTree:Tree;
		public function ControlsBar()
		{
			super();
			
			init();
		}
		
		private function init():void
		{
			title = "控件";
			
			addEventListener(PanelEvent.CLOSE, onCloseHandler);
			width = 200;
			height = 500;
			
			
			_freezeWidth = true;
			_freezeHeight = true;
			
			dragEnabled=true;
			minDragY = 0;
			
			_uiTree = new Tree();
			
			_uiTree.addEventListener(ListEvent.CLICK_ITEM,onClick);
		}
		
		/**
		 * 鼠标选中,可以开始拖动
		 * @param evt
		 */
		private function onClick(evt:ListEvent):void
		{

		}
		
		public function set model($items:DataProvider):void
		{
			var len:int = $items.length;
			
			_uiTree.dataProvider = $items;
			
			content = _uiTree;
		}
		
		private function onCloseHandler(evt:PanelEvent):void
		{
			Tracker.say("close");
		}
		
		override protected function draw():void
		{
			// TODO Auto Generated method stub
			super.draw();
		}
	}
}